<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>创建活动</title>
    <link rel="stylesheet" href="__STATIC__/css/weui.min.css">
    <link rel="stylesheet" href="__STATIC__/css/jquery-weui.min.css">
    <link rel="stylesheet" href="__STATIC__/css/index.css?v=123">
    <style>
        body{
            background-color: red;
        }
        html,body,.contents,.head_content,.head_content img{
            height:100%;
        }
    </style>
</head>
<body>
<div class="contents">
    <div class="head_content">
        <img src="__STATIC__/img/qrcode.jpg" alt="">
    </div>



    <button class="weui-btn  but ybtn"style="position: fixed;bottom: 0;z-index: 6;">立即创建</button>

    <div class="z_fee">

        <input type="text" name="name" style="margin-top: 35px" placeholder="请输入姓名"   id="name">
        <input type="phone" name="phone" placeholder="请输入手机号"  id="phone">
        <button id="lijizhifu">提交（提交后我们会立即联系您）</button>
    </div>
    <div id="mb"></div>
</div>
<script type="text/javascript" src="https://cdn.bootcss.com/jquery/2.1.4/jquery.js"></script>
<script type="text/javascript" src="__STATIC__/js/jquery-weui.min.js"></script>
<script type="text/javascript" src="__STATIC__/js/pulic.js"></script>
<script src="https://cdn.bootcss.com/Swiper/3.4.2/js/swiper.min.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">

    $('.ybtn').on('click',function(){
        $('.z_fee').css('display','block');
        $('.z_fee').css('bottom','0px');

        $('#mb').css('display','block');
    });
    $('#mb').on('click',function(){
        $('.z_fee').css('display','none');
        $('.z_fee').css('bottom','-250px');
        $('#mb').css('display','none');
    });

        $('#lijizhifu').on('click',function(){
            var name=$(" input[ name='name' ] ").val();
            var phone=$(" input[ name='phone' ] ").val();
            console.log(name);
            console.log(phone);
            if(name==null||phone==null){
                alert('姓名或手机号不能为空!');
                return false;
            }
            if(!(/^1[3|4|5|6|8|9][0-9]\d{4,8}$/.test(phone))){
                alert("不是完整的11位手机号或者正确的手机号前七位");
                return false;
            }else{
                $.ajax({
                    url: "{:url('chuangjian')}",
                    type: 'post',
                    data: {
                        name:name,
                        phone:phone
                    },
                    async: true,
                    success: function(res){
                    console.log(res);
                    if(res.code==200){
                        alert(res.msg);

                    }else{
                        alert(res.msg);
                    }
                },
                error: function () {
                    alert('网络错误请稍后再试');
                }
            });
            }
        });


</script>

</body>
</html>

